dwc_otg: fix several potential crash sources
authorP33M <p33m@github.com>
Fri, 12 May 2017 11:24:00 +0000 (12:24 +0100)
committerpopcornmix <popcornmix@gmail.com>
Mon, 15 May 2017 15:23:14 +0000 (16:23 +0100)
commit85b513b568d4060872bda15ba25b2fa6655cebf0
tree281756f620149a8236593d535dcf411c1ee5a00c
parent58a59941b77e91f9ab0f8b3428d4ceb1a8aa8884
dwc_otg: fix several potential crash sources

On root port disconnect events, the host driver state is cleared and
in-progress host channels are forcibly stopped. This doesn't play
well with the FIQ running in the background, so:
- Guard the disconnect callback with both the host spinlock and FIQ
  spinlock
- Move qtd dereference in dwc_otg_handle_hc_fsm() after the early-out
  so we don't dereference a qtd that has gone away
- Turn catch-all BUG()s in dwc_otg_handle_hc_fsm() into warnings.
drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
drivers/usb/host/dwc_otg/dwc_otg_hcd.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c